export default {
    data() {
        return {
            ifmounted:false,//用于处理keep-alive视图切换时执行activated与非keep-alives视图之间切换不执行activated方法做协调
        }
    },
    computed: {
        
    },
    created:function(){
        
    },
    methods:{
        /**
         * 返回
         */
        onClickLeft:function(){
            this.$router.go(-1);
        },
        /**
         * 页面显示
         */
        show() {
            var _this=this;
            var ele=document.getElementById('apparea');
            if(ele)
            {
                const classList = ele.classList;
                classList.add('animation-before')
                setTimeout(() => {
                    classList.add('animation-enter', 'animation-after', 'animation-show')
                    setTimeout(() => {
                        classList.remove('animation-before', 'animation-after', 'animation-enter');
                    }, 300)
                }, 20);
            }
        }
    },
    mounted:function(){
        this.ifmounted=true;
        this.show();
    },
    activated:function(){
        if(!this.ifmounted)
        {
            this.show();
        }
    },
    deactivated:function(){
        this.ifmounted=false;
    },
    beforeDestroy:function(){
        this.ifmounted=false;
    }
}
